using System;
using System.Collections;
using System.Data;
using System.Xml;

using OR.Reuse.Persistence;

namespace OR.Lazarus.Business.Entities.Config
{
   public class TransformCollection : OR.Lazarus.Business.Entities.Config.Lazarus.TransformCollection
   {
		protected string m_Library;

		public string Library
		{
			get
			{
				return ( m_Library );
			}
			set
			{
				m_Library = value;
			}
		}

		public virtual TransformCollection ListByType( string pType )
		{
			TransformCollection vReturn = new TransformCollection();

			foreach ( TransformDetail vTransform in this.List )
			{
				if ( vTransform.Type == pType )
				{
					vReturn.Add( vTransform );
				}
			}

			return ( vReturn );
		}

		public override void LoadXml( XmlElement p_oSource )
		{
			base.LoadXml ( p_oSource );

			m_Library = DataUtility.GetString( p_oSource, "library" );
		}

		public override XmlElement SaveXml( XmlDocument p_oDocument )
		{
			XmlElement	v_elReturn = base.SaveXml( p_oDocument );

			if ( !String.IsNullOrEmpty( m_Library ) )
			{
				v_elReturn.SetAttribute( "library", m_Library );
			}

			return ( v_elReturn );
		}

   }
}
   